package com.ideasmaker.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class HibernateUtil {
	
	private SessionFactory sessionFactory;
	
	private Configuration cfg;
	
	{
		cfg = new AnnotationConfiguration().configure();
//		sessionFactory = cfg.buildSessionFactory();
	}
	
	public Session getSession(){
		return sessionFactory.openSession();
	}
	
	public void createTable(){
		System.out.println("132123123");
		SchemaExport se = new SchemaExport(cfg);
		se.create(true, true);
	}
	
	public static void main(String[] args) {
		new HibernateUtil().createTable();
	}

}
